﻿using FwtXnaCommon.Maps;
using FwtXnaGame3.Engine;
using GpgCore.GameWorld;

namespace GpgGame.GameObjects.PlanetMaps
{
    public class VisualPlanetMap : Map<VisualPlanetMapCell>
    {
        public Planet Planet;
        
        public VisualPlanetMap(Scene scene, Planet planet) : base(scene, GodObject.PlanetMapSize)
        {
            CellMargin = 1;
            Planet = planet;
            Cols = planet.PlanetMap.Cols;
            Rows = planet.PlanetMap.Rows;
            FillMap();
        }

        public override void Start()
        {
            base.Start();

            IsDrawServiceShadow = true;
            IsDrawGui = true;
        }

        public override void UpdateCell(ref VisualPlanetMapCell cell)
        {
            var pmCell = Planet.PlanetMap.GetCell(cell.PosX, cell.PosY);
            if (pmCell == null)
                return;

            cell.TakeYourInfo(pmCell);
        }
    }
}
